# -*- coding : utf_8 -*-
"""
=======================================
Time : 2025/4/12 23:51
Author : 田霄汉
Email : 522989570@qq.com
File : matplotlib_class11.py
Project : pandas_demo
Function : 不同维度曲线和曲线叠加
=======================================
"""

import pandas as pd
import matplotlib.pyplot as plt
from config.setting import file_path

excel11_path = file_path['excel_path']+'/excel11.xlsx'

products = pd.read_excel(io=excel11_path,
                         skiprows=3,
                         usecols='C:H',
                         index_col='ID')
# # 展示三条不同年份的维度曲线
# products.plot(y=['2023', '2024', '2025'])
# 使用plot.area()将三条曲线进行叠加展示，类似plot.bar()柱状图叠加，stacked=True
products.plot.area(y=['2023', '2024', '2025'])
plt.title(label='BOOK TREND by YEAR', fontsize=16, fontweight='bold')
plt.ylabel(ylabel='YEAR', fontsize=12, fontweight='bold')
plt.xticks(ticks=products.index, fontsize=8)
plt.tight_layout()
plt.show()
